package org.yccloud.yc.demo.kt.model

import org.junit.jupiter.api.Test

class PersonTest {

    // 属性扩展
    val <T> List<T>.lastIndex: Int
        get() = size - 1

    @Test
    fun test() {
        val mainPerson = Person("main")
        val childPerson = Person("son", mainPerson)
        val childPerson2 = Person("消费", childPerson)

        println(mainPerson)
        println(childPerson)
    }

    @Test
    fun testExtends() {

        val alls = listOf("oj", "o")
        println(alls.lastIndex)

    }
}